//class LevFire extends InstantFire;
class LevFire extends ShockBeamFire;

var KObject K;
var LevManager LManager;

function DoTrace(Vector Start, Rotator Dir)
{
    local Vector X, End, HitLocation, HitNormal, RefNormal;
    local Actor Other;
    local int Damage;
    local bool bDoReflect;
    local int ReflectNum;

    MaxRange();

    ReflectNum = 0;
    //while (true)
    //{
        X = vector(Dir);
        End = Start + TraceRange * X;

        Other = Weapon.Trace(HitLocation, HitNormal, End, Start, true);
        //if object hit can be levitated...
        if (Other.IsA('LevObject')){
           //...and the player isnt already focusing on another LevObject
           if (!LevGun(Weapon).bPlayerControllerHasL){
              /***********************************************************
               CALL LevGun.SetL() TO INITIALIZE LEVITATION PARAMETERS ACROSS
               ALL OF THE OBJECTS INVOLVED IN THE PROCESS
              ***********************************************************/
              LevGun(Weapon).SetL(LevObject(Other));

              LevObject(Other).TakeDamage( 0, Instigator, vect(0,0,0), vect(0,0,0), LevGun(Weapon).getDType() );
           }
        }
        /*
        if ( Other != None && (Other != Instigator || ReflectNum > 0) )
        {
            if ( !Other.bWorldGeometry ){
                Damage = 0;

                // Update hit effect except for pawns (blood) other than vehicles.
                // ::TODO:: hit effect for grabbed objects
                if ( Other.IsA('Vehicle') || (!Other.IsA('Pawn') && !Other.IsA('HitScanBlockingVolume')) )
                    WeaponAttachment(Weapon.ThirdPersonActor).UpdateHit(Other, HitLocation, HitNormal);

                Other.TakeDamage(Damage, Instigator, HitLocation, Momentum*X, DamageType);

                HitNormal = Vect(0,0,0);
            }
            else if ( WeaponAttachment(Weapon.ThirdPersonActor) != None )
                WeaponAttachment(Weapon.ThirdPersonActor).UpdateHit(Other,HitLocation,HitNormal);
        }
        else
        {
            HitLocation = End;
            HitNormal = Vect(0,0,0);
            WeaponAttachment(Weapon.ThirdPersonActor).UpdateHit(Other,HitLocation,HitNormal);
        }
        */

       // SpawnBeamEffect(Start, Dir, HitLocation, HitNormal, ReflectNum);

    //}
}


defaultproperties
{
     DamageType=class'Enyara.DamTypeLev'
     DamageMin=0
     DamageMax=0
     TraceRange=17000.000000
     FireAnimRate=0.10000
     FireRate=0.1
     AmmoPerFire=0
     ShakeOffsetTime=0.1
     //FlashEmitterClass=class'XEffects.ShockBeamMuzFlash'
     FlashEmitterClass=none
     FireSound=sound'WeaponSounds.ShockRifle.ShockRifleFire'
     FireForce="ShockRifleFire"

     bWaitForRelease=true //fire button must be released between each shot
}
